import 'package:flutter/material.dart';
import 'package:wanxiang_app/widgets/tabs.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../pages/login/agreement.dart';
import 'account_textField2.dart';
import 'package:flutter_html/flutter_html.dart';
typedef void ClickCallBack(String content);
class MyAPrivacyDialog extends Dialog {
  ClickCallBack callBack;
  final String title ;
  final String msg ;
  final String sureText ;
  final String cancelText ;
  MyAPrivacyDialog({this.title='', this.msg='',this.cancelText='拒绝',this.sureText='同意',required this.callBack} );

  @override
  Widget build(BuildContext context) {
    return Material(
        //透明层
        type: MaterialType.transparency,
        child: Container(
          alignment: Alignment.center,
          child:    Container(
            alignment: Alignment.center,
              height: 404.h,
              width: 270.w,
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(10.r),
                  color: Colors.white
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text('隐私保护提示',style: TextStyle(color: Colors.black,fontSize: 20.sp,fontWeight: FontWeight.bold),),
                  SizedBox(height: 5.h,),
                  Container(
                      padding: EdgeInsets.only(left: 3.w,top: 5.h,right: 3.w,bottom: 5.h),
                    height: 300.h,
                    child:   SingleChildScrollView(
                        child: Container(
                          child: Html(data: msg,style: {
                            "p":Style(
                              fontSize: FontSize(18.sp)
                            )
                          },),
                        )
                    )
                  )
                ,
                  SizedBox(height: 20.h,),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      InkWell(
                          onTap: (){
                            callBack('cancel');
                          },
                          child:   Container(
                            padding: EdgeInsets.fromLTRB(10.w, 5.h, 10.w, 5.h),
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                                color: Color(0xFFCBCBCB),
                                borderRadius: BorderRadius.circular(4.r)
                            ),
                            child: Text(cancelText,style: TextStyle(color: Colors.white,fontSize: 13.sp),),
                          )
                      )
                      ,
                      SizedBox(width: 12.w,),
                      InkWell(
                          onTap: (){
                              callBack('sure');
                          },
                          child:     Container(
                            padding: EdgeInsets.fromLTRB(10.w, 5.h, 10.w, 5.h),
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                                color: Color(0xFFF43F50),
                                borderRadius: BorderRadius.circular(4.r)
                            ),
                            child: Text(sureText,style: TextStyle(color: Colors.white,fontSize: 13.sp),),
                          )
                      )

                    ],
                  )

                ],
              )
          )
        )

    );
  }
}